import {
  DesktopOutlined,
  PieChartOutlined,
  UserOutlined,
  HomeOutlined,
} from "@ant-design/icons";
import type { MenuProps } from "antd";

type MenuItem = Required<MenuProps>["items"][number];

function getItem(
  label: React.ReactNode,
  key: React.Key,
  icon?: React.ReactNode,
  children?: MenuItem[]
): MenuItem {
  return {
    key,
    icon,
    children,
    label,
  } as MenuItem;
}

const routerItem: MenuItem[] = [
  getItem("首页", "/page1", <HomeOutlined />),
  getItem("账户管理", "1", <UserOutlined />, [
    getItem("用户管理", "/userList"),
    getItem("管理员账号", "/admin"),
  ]),
  getItem("房屋管理", "2", <DesktopOutlined />, [
    getItem("房源管理", "/house"),
    getItem("房源申请", "/houseApplication"),
    // getItem("房源申请表", "/room"),
    // getItem("营业统计", "/total"),
  ]),
  // getItem("房源管理", "/page2", <PieChartOutlined />),
];

export default routerItem;
